<template>
  <div>
    <div class="recommend-title">
      Hot Recommend
    </div>
    <ul v-for="item in recommendList" :key="item.id">
      <router-link :to="'/detail/' + item.id" tag="li">
        <li class="item border-bottom">
          <div class="item-img-wrapper">
            <img :src="item.imgUrl" alt="#">
          </div>
          <div class="item-info">
            <p class="item-title">{{item.title}}</p>
            <p class="item-desc">{{item.desc}}</p>
            <button class="item-button">查看详情</button>
          </div>
        </li>
      </router-link>
    </ul>
  </div>
</template>

<script>
export default {
  name: "HomeRecommend",
  props: ['recommendList']
}
</script>

<style lang="scss" scoped>
$color_1: #333333;
$color_2: #ffffff;
$background-color_1: orange;

.recommend-title {
  margin-top: .2rem;
  line-height: 0.8rem;
  text-indent: .2rem;
  font-size: 0.4rem;
}

.item {
  display: flex;
  border-bottom: 1px solid rgba(204, 204, 204, .3);

  .item-img-wrapper {
    width: 125px;
    height: 96px;

    img {
      width: 100%;
      height: 100%;
      margin: .2rem;
    }
  }

  .item-info {
    flex: 1;
    margin: .3rem 0rem .3rem .4rem;

    .item-title {
      font-size: 0.4rem;
      font-weight: bold;
      line-height: 0.6rem;
    }

    .item-desc {
      font-size: 0.32rem;
      color: $color_1;
    }

    .item-button {
      width: 1.8rem;
      line-height: 0.6rem;
      margin-top: 10px;
      background-color: $background-color_1;
      color: $color_2;
      border-radius: 0.06rem;
    }
  }
}
</style>